package com.cradom.event.service.impl;

import java.util.List;
import java.util.Set;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cradom.event.dao.AuthorityDao;
import com.cradom.event.model.Permission;
import com.cradom.event.model.Role;
import com.cradom.event.service.AuthorityService;

@Service("AuthorityService")
public class AuthorityServiceImpl implements AuthorityService {

	@Resource
	private AuthorityDao authorityDao;
	
	public Boolean addRole(Role role) {
		return authorityDao.addRole(role);
	}

	public List<Role> getAllRole() {
		return authorityDao.getAllRole();
	}

	public List<Permission> getAllPermission() {
		return authorityDao.getAllPermission();
	}

	public Boolean addPermission(Permission permission) {
		return authorityDao.addPermission(permission);
	}

	public Boolean deleteRole(Integer id) {
		return authorityDao.deleteRole(id);
	}

	public Boolean deletePermission(Integer id) {
		return authorityDao.deletePermission(id);
	}

	public Set<String> getRoleContentByPhone(String phone) {
		return authorityDao.getRoleContentByPhone(phone);
	}

}
